home *** CD-ROM | disk | FTP | other *** search
/ CyberMycha 2008 January / Cybermycha 1_2008.iso / Data.cab / _77428C389754419EB2C8FD10F1ACEB26 < prev    next >
Encoding:
Text File  |  2004-03-17  |  994 b   |  45 lines

  1. regc( 0, "TFACTOR" )
  2. regc4f( 3, %dirtcolor_r, %dirtcolor_g, %dirtcolor_b, 0.0 )
  3. regc4f( 4, %dirtsnow, %dirtgravel, %dirtmud, 0.0 )
  4. regc4f( 5, %daycolor_r, %daycolor_g, %daycolor_b, %daycolor_a )
  5. regc4f( 6, %ambient_r, %ambient_g, %ambient_b, %ambient_a )
  6. pshader("
  7.  
  8. ps_1_1
  9.  
  10. #include <cardef.h>
  11. #define    DirtLevel    c0.a
  12. #define DirtColor    c3
  13. #define    DirtType    c4
  14. #define    DayColor    c5
  15.  
  16. #define    Diffuse        v0.a
  17. #define SpotDiffuse v0
  18. #define Ambient     c6
  19.  
  20. tex t0      ;texture 
  21. tex t1      ;Dirt
  22. tex t2      ;ColorMap
  23. tex    t3        ; Clouds
  24.  
  25.     mul_x2_sat    t2.a, t2.a, 1-t3.a        ; _x2_sat -> *SOFTSHADOWS = 2.0f
  26.  
  27.     dp3_sat    t1.rgb, DirtType, t1
  28.     +mul    r1.a, t2.a, Diffuse  
  29.     
  30.     mad     r1.rgb, Ambient, r1.a, Ambient.a      
  31.     +mul    r0.a, t1.b, DirtLevel
  32.  
  33.     lrp     t0.rgb, 1-r0.a, t0, DirtColor
  34.  
  35.     mul     r0.rgb, t0, r1        
  36.  
  37.     mul     r0.rgb, r0, DayColor
  38.     +mov    r0.a, t0.a
  39.     ; spot lights
  40. #if VS_SPOTLIGHTS
  41.     mad     r0.rgb, t0, SpotDiffuse, r0
  42. #endif
  43. ")
  44.  
  45.